package com.myschool.server.model;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="grade")
public class Grade extends BaseEntity {
	
	
	@Column(name = "grade_name", length = 25)
	private String gradeName;

	@Column(name = "grade_number", nullable = false)
	private Long gradeNumber;
	 
	@ManyToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
	private School school;
	
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
	private Set<Section> sections;

	/**
	 * @return the school
	 */
	public School getSchool() {
		return school;
	}

	/**
	 * @param school the school to set
	 */
	public void setSchool(School school) {
		this.school = school;
	}

	/**
	 * @return the sections
	 */
	public Set<Section> getSections() {
		return sections;
	}

	/**
	 * @param sections the sections to set
	 */
	public void setSections(Set<Section> sections) {
		this.sections = sections;
	}

	public String getGradeName() {
		return gradeName;
	}

	public void setGradeName(String gradeName) {
		this.gradeName = gradeName;
	}

	public Long getGradeNumber() {
		return gradeNumber;
	}

	public void setGradeNumber(Long gradeNumber) {
		this.gradeNumber = gradeNumber;
	}
	
	
}
